/**
  ******************************************************************************
  * File Name          : device.h
  * Description        : This file provides code for the configuration
  *                      of the device instances.
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __device_H
#define __device_H


/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include "bsp.h"
#include "route_ec_interface.h"

#define NTC_TRSMSG_QUE_LENGTH       2
#define NTC_TRSMSG_QUE_ITEMSIZE     sizeof(uint8_t)

#if(COLLECTOR_USE_TYPE == COLLECTOR_USE_LORA)
#define COLLECTOR_LORADEV_MAXNUM    16U
#else
#define COLLECTOR_LORADEV_MAXNUM    4U
#endif

typedef struct
{
	volatile Collector_DataType device[COLLECTOR_LORADEV_MAXNUM];
  volatile uint8_t            update[COLLECTOR_LORADEV_MAXNUM];
  volatile Collector_DataType average;
	uint8_t   invalidcnt;
	uint8_t   updateflag;
}Collector_LocalDataType;

extern volatile Collector_LocalDataType  Collector_LocalData;

extern void NTC_Config(void);

#if(COLLECTOR_USE_TYPE == COLLECTOR_USE_NTC)
extern void NtcPow_GetValue(volatile uint8_t *pow_flag, uint8_t *err_typ, uint8_t *err_cnt);
#else
extern void Pow_GetValue(volatile uint8_t *pow_flag);
#endif

#endif /* __device_H */

/**
  * @}
  */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
